﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sample.Messages;
using SimpleServiceBus.Bus.MessageManagement.MessageHandling;

namespace SampleConsumer.Handlers {
    public class OtherHandler: IMessageHandler<OtherTopic> {

        /* Note that the endpoint must be configured with a SetupMessageTypes section in order to receive OtherTopic subclasses, otherwise the xml
         * serializer won't be able to deserialize the classes, unless there is a handler on Area4 which would automatically register the type.
                .SetupMessageTypes(x => {
                    x.Register(typeof(Area4)); 
                })
         */

        public void Handle(OtherTopic message, SimpleServiceBus.Bus.Pipeline.IMessageContext context) {
            Logger.Log("Received Area4 topic. OtherValue = {0}", message.OtherValue);
        }

    }
}
